<?php include('./templete/public/head.php')?>
<script src="_js/plug/menudown.js"></script>
<body>

<!--搜索-->
<div class="comm-search">
    <div class="search-input">
        <i class="iconfont icon-sousuo"></i>
        <input type="text" name="" id="title" value="<?php echo input('title')?>" placeholder="请输入您要搜索的建议" onchange="search()"/>
    </div>
</div>
<!--搜索标签-->
<div class="search-tag">
    <div class="tag1">
        <a <?php if($model==4){?>class="active"<?php }?> href="<?php echo url('jdz/joinjdz',['model'=>4])?>">等待评估</a>
        <a <?php if($model==1){?>class="active"<?php }?> href="<?php echo url('jdz/joinjdz',['model'=>1])?>">我提你改</a>
        <a <?php if($model==2){?>class="active"<?php }?> href="<?php echo url('jdz/joinjdz',['model'=>2])?>">自提自改</a>
        <a <?php if($model==3){?>class="active"<?php }?> href="<?php echo url('jdz/joinjdz',['model'=>3])?>">寻求合作</a>
        <a <?php if($model==5){?>class="active"<?php }?> href="<?php echo url('jdz/joinjdz',['model'=>5])?>">复活提议</a>
    </div>
    <div class="tag2">
        <ul class="topmenu">
            <!--请选择公司-->
            <li>
                <div class="selectlist">
                    <div class="select_textdiv">
                        <input type="hidden"  id="question_type" value="">
                        <div>
                            <p class="s_text one-txt-cut">问题分类</p>
                            <span class="down"><i class="iconfont icon-xiaosanjiaodown"></i></span>
                        </div>
                    </div>
                    <div class="select_textul">
                        <ul class="select_first_ul">
                            <li ><p data-type="1">产品质量</p></li>
                            <li ><p data-type="2">产品成本</p></li>
                            <li ><p data-type="3">产品性能</p></li>
                            <li ><p data-type="4">标准作业程序</p></li>
                            <li ><p data-type="5">工作流程</p></li>
                            <li ><p data-type="6">设备</p></li>
                            <li ><p data-type="7">设施</p></li>
                            <li ><p data-type="8">物料储运</p></li>
                            <li ><p data-type="9">环境、健康、安全</p></li>
                            <li ><p data-type="10">食堂及伙食</p></li>
                            <li ><p data-type="11">其他</p></li>
                        </ul>
                    </div>
                </div>
            </li>
            <!--请选择问题-->
            <li>
                <div class="selectlist">
                    <div class="select_textdiv">
                        <input type="hidden" id="depart_id" value="">
                        <div>
                            <p class="s_text one-txt-cut">请选择部门</p>
                            <span class="down"><i class="iconfont icon-xiaosanjiaodown"></i></span>
                        </div>
                    </div>
                    <div class="select_textul">
                        <ul class="select_first_ul">
                            <?php foreach ($department['data'] as $v){?>
                                <li ><p data-type="<?php echo $v['id']?>"><?php echo $v['name']?></p></li>
                            <?php }?>
                        </ul>
                    </div>
                </div>
            </li>
            <!--请选择状态-->
        </ul>
    </div>
</div>
<hr class="bgcolor"/>

<!--最热提议-->
<div class="index-main hot-proposal">
    <div class="main-content proposal-content">
        <div class="c-list">

        </div>
    </div>
</div>

</body>

</html>
<script>

    get_jdz_list();
    function get_jdz_list() {
        var question_type =$('#question_type').val();
        var depart_id = $('#depart_id').val();
        var title = $("#title").val();
        $.ajax({
            url:'<?php echo url('jdz/get_join_list')?>',
            data:{
                question_type:question_type,
                depart_id:depart_id,
                status:status,
                title:title,
                complete_type:<?php echo $model?>,
                page:1
            },
            type:'post',
            success:function (data) {
                $(".c-list").html(data);
            }
        })
    }

    function search() {
        var title=$('#title').val();
        window.location.href="/index/jdz/joinjdz.html?title="+title;
    }

    $(function() {
        var page = 2;
        var load_flag = true;
        $(window).scroll(function() {
            var question_type =$('#question_type').val();
            var depart_id = $('#depart_id').val();
            var status =$('#status').val();
            var title = $("#title").val();
            var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
            var documentheight = parseFloat($(document).height());
            if (documentheight - totalheight <= 200) {
                if(load_flag){
                    load_flag=!load_flag;
                    $.ajax({
                        url:'<?php echo url('jdz/get_join_list')?>',
                        data:{
                            question_type:question_type,
                            depart_id:depart_id,
                            status:status,
                            title:title,
                            page:page,
                            complete_type:<?php echo $model?>
                        },
                        success: function(data) {
                            $(".c-list").append(data);
                        }
                    })
                }

            }
        });
    });

</script>